<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            /* box-sizing: border-box; */
        }

        body {
            background: url(/pink/imgs/04.png) no-repeat;
            background-size: cover;
        }

        ul {
            display: flex;
            justify-content: center;
            align-items: center;
            /* text-align: center; */
            margin: 20px auto;
            width: 800px;
            border: 3px solid #fff;
            background-color: rgba(0, 0, 0, 0.397);
        }

        li {
            list-style: none;
            margin: 0 5px;
        }

        li img {
            /* 如果图片有缝隙 ，就把他变成块级元素 */
            display: block;
            width: 190px;
            height: 130px;
        }
    </style>
</head>

<body>
    <ul>
        <li><img src="/pink/imgs/04.png" alt=""></li>
        <li><img src="/pink/imgs/zyz_txt/1.png" alt=""></li>
        <li><img src="/pink/imgs/彭于晏.png" alt=""></li>
        <li><img src="/pink/imgs/zyz_txt/2.png" alt=""></li>
    </ul>
    <script>
        var lis = document.querySelector('ul').querySelectorAll('li img')
        // var img=lis.document.querySelectorAll('img')
        for (let i = 0; i < lis.length; i++) {
            lis[i].onclick = function () {
               document.body.style.backgroundImage='url('+this.src+')'
            }
        }
    </script>
</body>

</html>